# Whether Notification manager is running at the kubesphere.
kubesphere: true

# notification-manager-operator
operator: 
  containers:
    proxy:
      image:
        repo: {{ notification_manager_operator_proxy_repo }}
        tag: {{ notification_manager_operator_proxy_tag }}
        pullPolicy: IfNotPresent
      resources:
        limits:
          cpu: {{ monitoring.notification_manager.proxy.resources.limits.cpu | default("50m") }}
          memory: {{ monitoring.notification_manager.proxy.resources.limits.memory | default("50Mi") }}
        requests:
          cpu: {{ monitoring.notification_manager.proxy.resources.requests.cpu | default("5m") }}
          memory: {{ monitoring.notification_manager.proxy.resources.requests.memory | default("10Mi") }}
    operator:
      image:
        repo: {{ notification_manager_operator_repo }}
        tag: {{ notification_manager_operator_tag }}
        pullPolicy: IfNotPresent 
      resources:
        limits:
          cpu: {{ monitoring.notification_manager.operator.resources.limits.cpu | default("50m") }}
          memory: {{ monitoring.notification_manager.operator.resources.limits.memory | default("50Mi") }}
        requests:
          cpu: {{ monitoring.notification_manager.operator.resources.requests.cpu | default("5m") }}
          memory: {{ monitoring.notification_manager.operator.resources.requests.memory | default("20Mi") }}
{% if monitoring.nodeSelector is defined and monitoring.nodeSelector is not none %}
  nodeSelector:
    {{ monitoring.nodeSelector | to_nice_yaml(indent=2) | indent(4) }}
{% elif nodeSelector is defined and nodeSelector is not none %}
  nodeSelector:
    {{ nodeSelector | to_nice_yaml(indent=2) | indent(4) }}
{% else %}
  nodeSelector: {}
{% endif %}
{% if monitoring.tolerations is defined and monitoring.tolerations is not none %}
  tolerations:
    {{ monitoring.tolerations | to_nice_yaml(indent=2) | indent(4) }}
{% elif tolerations is defined and tolerations is not none %}
  tolerations:
    {{ tolerations | to_nice_yaml(indent=2) | indent(4) }}
{% else %}
  tolerations: []
{% endif %}
{% if monitoring.affinity is defined and monitoring.affinity is not none %}
  affinity:
    {{  monitoring.affinity | to_nice_yaml(indent=2) | indent(4) }}
{% elif affinity is defined and affinity is not none %}
  affinity:
    {{ affinity | to_nice_yaml(indent=2) | indent(4) }}
{% else %}
  affinity: {}
{% endif %}


# value of notification-manager
notificationmanager:
  name: notification-manager
  image:
    repo: {{ notification_manager_repo }}
    tag: {{ notification_manager_tag }}
    pullPolicy: IfNotPresent
{% if nodeNum is defined and nodeNum < 3 %}
  replicas: 1
{% else %}
  replicas: 2
{% endif %}
  resources:
    limits:
      cpu: {{ monitoring.notification_manager.resources.limits.cpu | default("500m") }}
      memory: {{ monitoring.notification_manager.resources.limits.memory | default("500Mi") }}
    requests:
      cpu: {{ monitoring.notification_manager.resources.requests.cpu | default("5m") }}
      memory: {{ monitoring.notification_manager.resources.requests.memory | default("20Mi") }}
{% if monitoring.nodeSelector is defined and monitoring.nodeSelector is not none %}
  nodeSelector:
    {{ monitoring.nodeSelector | to_nice_yaml(indent=2) | indent(4) }}
{% elif nodeSelector is defined and nodeSelector is not none %}
  nodeSelector:
    {{ nodeSelector | to_nice_yaml(indent=2) | indent(4) }}
{% else %}
  nodeSelector: {}
{% endif %}
{% if monitoring.tolerations is defined and monitoring.tolerations is not none %}
  tolerations:
    {{ monitoring.tolerations | to_nice_yaml(indent=2) | indent(4) }}
{% elif tolerations is defined and tolerations is not none %}
  tolerations:
    {{ tolerations | to_nice_yaml(indent=2) | indent(4) }}
{% else %}
  tolerations: []
{% endif %}
{% if monitoring.affinity is defined and monitoring.affinity is not none %}
  affinity:
    {{  monitoring.affinity | to_nice_yaml(indent=2) | indent(4) }}
{% elif affinity is defined and affinity is not none %}
  affinity:
    {{ affinity | to_nice_yaml(indent=2) | indent(4) }}
{% else %}
  affinity: {}
{% endif %}
  defaultConfigSelector:
    matchLabels:
      type: default
  receivers:
    tenantKey: user
    globalReceiverSelector:
      matchLabels:
        type: global
    tenantReceiverSelector:
      matchLabels:
        type: tenant
    options:
      global:
        templateFile:
        - /etc/notification-manager/template
      email:
        notificationTimeout: 5
        deliveryType: bulk
      slack:
        notificationTimeout: 5
      wechat:
        notificationTimeout: 5
  volumeMounts:
    - mountPath: /etc/notification-manager/
      name: notification-manager-template
  volumes:
    - configMap:
        defaultMode: 420
        name: notification-manager-template
      name: notification-manager-template
  defaultSecretNamespace: kubesphere-monitoring-federated
  sidecars:
    tenant:
      image: {{ notification_tenant_sidecar_repo }}:{{ notification_tenant_sidecar_tag }}
      name: tenant
      type: kubesphere

